package com.koron.css2.clientCenter.impl;

import com.koron.css2.ServerInterface;
import com.koron.css2.clientCenter.bean.UserCloseDetailBean;
import com.koron.css2.clientCenter.mapper.CloseUserMapper;
import com.koron.css2.serviceManage.bean.RequestBean;
import com.koron.css2.serviceManage.bean.UserInfoBean;
import com.koron.util.Constant;
import com.koron.util.JsonUtils;
import org.koron.ebs.mybatis.SessionFactory;
import org.swan.bean.MessageBean;

/**
 * 用户销户详情删除
 * 可批量、可单个
 * @author 张涛
 *
 */
public class CloseUserDetailDelete implements ServerInterface {

	@Override
	public MessageBean<?> exec(SessionFactory factory, UserInfoBean userInfo, RequestBean req) {
		try {
			CloseUserMapper mapper = factory.getMapper(CloseUserMapper.class);
			UserCloseDetailBean bean = JsonUtils.objectToPojo(req.getData(), UserCloseDetailBean.class);
			// 删除
//			mapper.userCloseDetailDelete(bean);
			return MessageBean.create(Constant.MESSAGE_INT_SUCCESS, "删除成功", void.class);
		} catch (Exception e) {
			logger.error("删除失败", e);
			return MessageBean.create(Constant.MESSAGE_INT_FAIL, "删除失败", void.class);
		}
	}

}
